package com.coolwen.service;

import com.coolwen.dao.RoleResourceMapper;
import com.coolwen.entity.RoleResource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by user on 2016/6/11.
 */
@Service("roleResourceService")
public class RoleResourceServiceImpl implements RoleResourceService {
    @Autowired
    private RoleResourceMapper roResDao;

    @Override
    public int add(RoleResource roleResource) {
        return roResDao.insertSelective(roleResource);
    }

    @Override
    public int delete(long id) {
        return roResDao.deleteById(id);
    }

    @Override
    public int update(RoleResource roleResource) {
        return roResDao.updateById(roleResource);
    }

    @Override
    public RoleResource load(long id) {
        return roResDao.selectById(id);
    }

    @Override
    public int deleteByRR(long roleid, long resid) {
        return roResDao.deleteByRR(roleid,resid);
    }


}
